﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using He.Web.UI;
using He.Common;

namespace He.Web.manage.logistics
{
    public partial class progress_list : Manage
    {
        public string orderNumber;
        public string pos_mark;
        protected void Page_Load(object sender, EventArgs e)
        {
            pos_mark = GetString("pos_mark");
            orderNumber = GetString("orderNumber");
            CookieHelper.Set("LastListUrl", Request.RawUrl);    //保存最后一次访问的列表页Url
            if (!this.Page.IsPostBack)
            {
                rptList.DataSource = new BLL.logistics_status().GetList("order_number='" + orderNumber + "' order by id desc");
                rptList.DataBind();
            }
        }

        protected void lbtnDel_Click(object sender, EventArgs e)
        {
            chkLoginLevel("del" + pos_mark);
            BLL.logistics_status bll = new BLL.logistics_status();
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("Check");
                int id = int.Parse(((Label)rptList.Items[i].FindControl("lb_id")).Text);
                if (cb.Checked)
                {
                    bll.Delete(id);
                }
            }
            SaveLogs("[物流管理]批量删除");
            JscriptPrint("批量删除成功啦！", Request.RawUrl, "Success");
        }
    }
}